package com.sky.business.sys.event;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 结束跟踪事件上报消息
 *
 */
@Data
@NoArgsConstructor
public class CmccEndTrackingReportEvent extends BaseEvent {


    /**
     * 元数据
     */
    private Metadata metadata;

    /**
     * 构造器
     *
     * @param edgeId   边缘中心id
     * @param deviceId 设备id
     * @param taskId   任务id
     * @param workState 工作状态
     * @param codeStatus 操作状态
     * @param message   描述信息
     * @param cameraStatus 设备状态
     */
    public CmccEndTrackingReportEvent(String edgeId, String deviceId, String taskId, Integer workState, Integer codeStatus, String message, CameraStatus cameraStatus) {
        super("EndTracking", edgeId);
        metadata = new Metadata();
        metadata.setDeviceId(deviceId);
        metadata.setTaskId(taskId);
        metadata.setWorkState(workState);
        metadata.setCodeStatus(codeStatus);
        metadata.setMessage(message);
        metadata.setCameraStatus(cameraStatus);
    }

    /**
     * 元数据
     */
    @Data
    public static class Metadata extends ErrorMetadata{
        /**
         * 任务id
         */
        private String taskId;
        /**
         * 设备id
         */
        private String deviceId;
        /**
         * 工作状态
         */
        private Integer workState;
        /**
         * 相机状态
         */
        @JsonInclude(JsonInclude.Include.NON_NULL)
        private CameraStatus cameraStatus;
    }

}
